<?php
require_once("header.php");
//权限判断
//session_start();
require_once('check.php');
require_once('../system/conndb.php');
//可以加上 $_POST['']的判断

$sql = "select * from videotype";

//echo $sql;
//exit;
$link = connect();
$result = mysqli_query($link,$sql);
//var_dump($result);exit;
//$num= mysqli_affected_rows($result);
$videotypes = mysqli_fetch_all($result,MYSQLI_ASSOC);

?>
<main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
      <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
        <h1 class="h2">视频管理</h1>
        <div class="btn-toolbar mb-2 mb-md-0">
          <div class="btn-group mr-2">
            <button type="button" class="btn btn-sm btn-outline-secondary">Share</button>
            <button type="button" class="btn btn-sm btn-outline-secondary">Export</button>
          </div>
          <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle">
            <span data-feather="calendar"></span>
            This week
          </button>
        </div>
      </div>
	  
	  <form action="dovideoadd.php" 
		method="post"
		enctype="multipart/form-data">
  <div class="form-group row">
    <label for="inputEmail3" 
	class="col-sm-2 col-form-label">视频名称</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="inputEmail3" 
	  name="videoname" required>
    </div>
  </div>
  <div class="form-group row">
    <label for="inputPassword3" class="col-sm-2 col-form-label">视频类型</label>
    <div class="col-sm-10">
      <select name="videotype" class="form-control" required>
		 <option>==请选择==</option>
		 <?php
			foreach($videotypes as $vt){
				echo '<option value="'.$vt["tid"].'">'.$vt["typename"].'</option>';
				
			}		 
		 ?>
	  </select>
    </div>
  </div>
  
  <div class="form-group row">
    <label for="inputEmail3" 
	class="col-sm-2 col-form-label">视频海报</label>
    <div class="col-sm-10">
      <input type="file" class="form-control" id="inputEmail3" 
	  name="pic" required>
    </div>
  </div>
  
  
  <div class="form-group row">
    <label for="videointro" 
	class="col-sm-2 col-form-label">视频简介</label>
    <div class="col-sm-10">
      <textarea name="videointro" rows="3" 
	  class="form-control" id="videointro" required></textarea>   
    </div>
  </div>
  
  <div class="form-group row">
    <label for="address" 
	class="col-sm-2 col-form-label">上传视频</label>
    <div class="col-sm-10">
      <input type="file" class="form-control" id="address" 
	  name="address" required>
    </div>
  </div>
  
  <div class="form-group row">
    <label for="inputEmail3" 
	class="col-sm-2 col-form-label">推荐幻灯片</label>
    <div class="col-sm-10">
        <div class="form-check form-check-inline">
		  <input class="form-check-input" type="radio" name="istop" id="inlineRadio1" value="0" checked>
		  <label class="form-check-label" for="inlineRadio1">否</label>
		</div>
		<div class="form-check form-check-inline">
		  <input class="form-check-input" type="radio" name="istop" id="inlineRadio2" value="1">
		  <label class="form-check-label" for="inlineRadio2">是</label>
		</div>
    </div>
  </div>
  
  <div class="form-group row">
    <div class="col-sm-10">
      <button type="submit" class="btn btn-primary">提交</button>
    </div>
  </div>
</form>
	  
	  
	</main>

<?php
require_once("footer.php");
?>